<template>
  <div>
    <div class="container">
      <!-- 顶部功能条 -->
      <div class="Center_header">
        <div class="headss" v-if="lognu">
          <div class="btn1" @click="ers">
            <div class="btna"></div>
          </div>
          <div class="btn2">
            <router-link tag="div" to="/settings" class="btna"></router-link>
          </div>
        </div>
      </div>
      <!-- 顶部功能条 END-->

      <!-- 个人登录栏目 -->

      <router-link to="/login" tag="div" class="log_in">
        <div class="box">
          <div class="head_portrait">
            <img src="../assets/imgs/头像.jpg" alt="" v-if="lognu" />
            <img
              src="../assets/imgs/icons/src_assets_img_lazy_defaultavatar.png"
              alt=""
              v-if="!lognu"
            />
          </div>
          <div class="logIn_text" v-if="lognu">
            <p>吃瓜者</p>
            <span>点击设置社群身份</span>
          </div>
          <div class="logIn_text" v-if="!lognu">
            <span class="ccon">未登录</span>
          </div>
        </div>
        <div class="logIn_btn"></div>
      </router-link>

      <!-- 个人登录栏目 END-->

      <!-- 详细信息 -->
      <!-- <div class="FunBox">
        <div class="personaFun">
          <div class="personaFun_item">
            <div class="item_num">0</div>
            <div class="item_name">收藏职位</div>
          </div>
          <div class="personaFun_item">
            <div class="item_num">0</div>
            <div class="item_name">关注公司</div>
          </div>
        </div>
      </div> -->
      <!-- 详细信息 END-->

      <!-- VIP -->

      <div class="vip">
        <div class="vip_text">
          <p class="vip_title1">升级VIP立享专属特权</p>
          <p class="vip_title2">尊享6大专属特权</p>
        </div>
        <router-link tag="div" to="/svip" class="vip_btn">立刻升级</router-link>
      </div>
      <div class="vipCard">
        <div class="Card_item">
          <div class="Card_imgs" @click="gotfun">
            <img src="../assets/imgs/修改.png" alt="" />
            <div class="Card_text">简历修改</div>
          </div>

          <router-link tag="div" to="/purpose" class="Card_imgs">
            <img src="../assets/imgs/投简.png" alt="" />
            <div class="Card_text">求职意向</div>
          </router-link>

          <router-link tag="div" to="/afen" class="Card_imgs">
            <img src="../assets/imgs/礼品.png" alt="" />
            <div class="Card_text">收藏职位</div>
          </router-link>

          <router-link tag="div" to="/svip" class="Card_imgs">
            <img src="../assets/imgs/vip.png" alt="" />
            <div class="Card_text">超级会员</div>
          </router-link>
        </div>
      </div>

      <!-- VIP END-->

      <!-- 列表 -->
      <div class="funBtn">
        <!-- 我的订单 -->
        <router-link tag="div" to="/order" class="funBtn_item">
          <div class="funBtn_box">
            <div class="funBtn_text dt">我的订单</div>
            <div class="funBtn_t"></div>
          </div>
        </router-link>

        <!-- PC联动 -->
        <router-link tag="div" to="/pc" class="funBtn_item">
          <div class="funBtn_box">
            <div class="funBtn_text">电脑端制作简历</div>
            <div class="funBtn_t pc"></div>
          </div>
        </router-link>

        <!-- 分享按钮 -->
        <div class="funBtn_item" @click="showShare = true">
          <div class="funBtn_box">
            <div class="funBtn_text app">分享APP</div>
            <div class="funBtn_t"></div>
          </div>
        </div>

        <!-- 关于页面 -->
        <router-link to="/cation" tag="div" class="funBtn_item">
          <div class="funBtn_box">
            <div class="funBtn_text ky">关于</div>
            <div class="funBtn_t"></div>
          </div>
        </router-link>
      </div>
      <!-- 按钮栏目 END-->

      <van-share-sheet
        v-model="showShare"
        title="立即分享给好友"
        :options="options"
      />
    </div>

    <!-- 底部固定导航栏 -->
    <div class="shroud">
      <div class="container container_ji">
        <div class="shroudPanel">
          <div class="icon">
            <router-link to="/home" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_cv_normal.png"
                alt=""
              />
            </div>
            <span>首页</span>
          </div>
          <div class="icon">
            <router-link to="/jobwant" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_job_normal.png"
                alt=""
              />
            </div>
            <span>求职</span>
          </div>
          <div class="icon">
            <router-link to="/curr" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_lesson_normal.png"
                alt=""
              />
            </div>
            <span>课程</span>
          </div>
          <div class="icon">
            <router-link to="/message" tag="div" class="iconrun"></router-link>
            <div class="img message">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_message_normal.png"
                alt=""
              />
              <ul class="list_message">
                <!-- <div class="message_sum">99+</div> -->
              </ul>
            </div>
            <span class="con">消息</span>
          </div>
          <div class="icon">
            <router-link to="/personal" tag="div" class="iconrun"></router-link>
            <div class="img">
              <img
                src="../assets/imgs/src_assets_img_tab_tab_me_selected.png"
                alt=""
              />
            </div>
            <span>我</span>
          </div>
        </div>
      </div>
    </div>
    <div class="shr"></div>
    <!-- 底部固定导航栏 END-->

    <!-- 未登录提示 -->
    <div class="aasi">
      <van-dialog
        v-model="show"
        title="标题"
        message="请先登录再查看内容"
        show-cancel-button
        round-button
        confirm-button-text="跳转登录页面"
        @confirm="loginto"
        confirm-button-color="#5c94f5"
      >
      </van-dialog>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      lognu: null,
      showShare: false,
      show: false,
      onSelect: null,
      options: [
        [
          { name: "微信", icon: "wechat" },
          { name: "朋友圈", icon: "wechat-moments" },
          { name: "微博", icon: "weibo" },
          { name: "QQ", icon: "qq" },
        ],
        [
          { name: "复制链接", icon: "link" },
          { name: "分享海报", icon: "poster" },
          { name: "二维码", icon: "qrcode" },
          { name: "小程序码", icon: "weapp-qrcode" },
        ],
      ],
    };
  },
  methods: {
    ers() {
      this.$toast("触发二维码相机");
    },
    gotfun() {
      let token = localStorage.getItem("token");
      if (!localStorage.getItem("oniu") && token) {
        // this.$emit("gotfun",false)
        this.$toast("尚未创建简历请创建");
        this.$router.push("template");
      } else if (!token) {
        this.show = true;
      } else {
        this.$router.push("creator");
      }
    },
    loginto() {
      this.$router.push("loginto");
    },
  },
  created() {
    this.lognu = window.localStorage.getItem("token");
  },
  onSelect(option) {
    // Toast(option.name);
    // this.showShare = false;
    // this.$toast(option.name);
    console.log(option);
  },
};
</script>

<style lang="scss" scoped>
// 分享弹窗
.container ::v-deep .van-share-sheet__options {
  justify-content: space-around;
}

// 弹窗内容样式
.aasi ::v-deep .van-dialog__message {
  font-size: 20px;
  padding: 50px 60px;
}

.Center_header {
  height: 40px;
  background-color: #fff;
  .headss {
    display: flex;
    height: 40px;
    background-color: #fff;
    align-items: center;
    justify-content: flex-end;
    .btn2 {
      a {
        margin-right: 38px;
        background: url(../assets/imgs/设置.png) no-repeat center center;
        background-size: 100%;
      }
    }
  }
}
.Center_header .headss .btn1 .btna {
  display: block;
  width: 20px;
  height: 20px;
  background: url(../assets/imgs/扫码.png) no-repeat center center;
  background-size: 100%;
  margin: 0px 13px;
}
.Center_header .headss .btn2 .btna {
  background: url(../assets/imgs/设置.png) no-repeat center center;
  display: block;
  width: 20px;
  height: 20px;
  background-size: 100%;
  margin: 0px 13px;
}

/* 个人登录栏目 */
.log_in {
  display: flex;
  width: 100%;
  height: 80px;
  background-color: #fff;
  justify-content: space-between;
  align-items: center;
  .box {
    .head_portrait {
      width: 58px;
      height: 58px;
      border-radius: 50%;
      margin-right: 18px;
      margin-left: 26px;
      overflow: hidden;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}
.box {
  display: flex;
  align-items: center;
}
.logIn_text {
  span {
    display: block;
    height: 12px;
    line-height: 12px;
    font-size: 12px;
    color: #999;
  }
  .ccon {
    font-size: 20px;
    line-height: 20px;
    color: #2b2b2b;
  }
  p {
    height: 40px;
    line-height: 20px;
    font-size: 18px;
    color: #2b2b2b;
  }
}
.logIn_btn {
  width: 20px;
  height: 40px;
  margin-right: 20px;
  background: url(../assets/imgs/右箭头.png) no-repeat center center;
  background-size: 100%;
}
/* 详细信息 */
.FunBox {
  width: 100%;
  height: 100%;
  background-color: #fff;
  padding-bottom: 26px;
}
.personaFun {
  display: flex;
  margin-left: 26px;
  .personaFun_item {
    display: flex;
    width: 60px;
    margin-right: 45px;
    font-size: 14px;
    flex-direction: column;
    align-items: center;
    .item_num {
      margin-top: 16px;
      margin-bottom: 10px;
      font-weight: 800;
    }
    .item_name {
      color: #999;
    }
  }
}
/* vip */
.vip {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: 80px;
  background: url(../assets/imgs/bc.jpg) no-repeat top center;
  background-size: 102% 110%;
  padding: 0px 38px;
  margin-top: 45px;
  justify-content: space-between;
}
.vip_text {
  margin-top: 12px;
  color: #f5dd9f;
  font-size: 14px;
  .vip_title1 {
    position: relative;
    text-indent: 30px;
    height: 25px;
    line-height: 25px;
    &::before {
      content: "";
      display: block;
      position: absolute;
      width: 30px;
      height: 16px;
      background: url(../assets/imgs/VIP-1.png) no-repeat center center;
      background-size: 100%;
      top: 5px;
      left: -4px;
    }
  }
}
.vip_btn {
  width: 85px;
  height: 40px;
  line-height: 40px;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  border-radius: 10px;
  font-weight: 800;
  background-color: #efd9a0;
  background-image: linear-gradient(to right, #fffdd6, #fef7a7);
}
/* 项目选择 */
.vipCard {
  box-sizing: border-box;
  height: 110px;
  overflow: hidden;
  margin: 0px 20px;
  margin-top: 12px;
  box-shadow: 0px 0px 5px 0px #ccc;
  .Card_item {
    display: flex;
    height: 110px;
    justify-content: space-around;
    align-items: center;
    border-radius: 10px;
    background-color: #fff;
    .Card_imgs {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 70px;
      height: 90px;
      img {
        width: 100%;
        display: block;
        margin-bottom: 10px;
      }
    }
  }
}
.Card_imgs {
  .Card_text {
    font-weight: 800;
    font-size: 14px;
    padding-bottom: 16px;
  }
}
/* 按钮栏目 */
.funBtn {
  width: 100%;
  box-sizing: border-box;
  padding: 0px 20px;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
}
.funBtn_item {
  width: 100%;
  height: 50px;
  background-color: #fff;
  margin: 5px 0px;
  box-shadow: 0px 0px 5px 0px #ccc;
  &:nth-child(1) {
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
    background-color: #fff;
  }
}
.funBtn_box {
  display: flex;
  height: 50px;
  line-height: 50px;
  justify-content: space-between;
  .funBtn_text {
    position: relative;
    text-indent: 55px;
    &::before {
      content: "";
      display: block;
      position: absolute;
      width: 24px;
      height: 24px;
      background: url(../assets/imgs/icon_pc.png) 0px 0px no-repeat;
      background-size: 100%;
      top: 0px;
      bottom: 0px;
      left: 20px;
      margin: auto 0;
    }
  }
  .dt {
    &::before {
      background-position: 0px -28px;
    }
  }
  .kf {
    &::before {
      background-position: 0px -55px;
    }
  }
  .app {
    &::before {
      background-position: 0px -80px;
    }
  }
  .ky {
    &::before {
      background-position: 0px -106px;
    }
  }
  .funBtn_t {
    position: relative;
    padding-right: 18px;
    &.pc {
      &::before {
        content: "编辑更高效";
        display: block;
        position: absolute;
        height: 50px;
        line-height: 50px;
        width: 200px;
        left: -70px;
        font-size: 12px;
        color: #999;
      }
    }
  }
}
/* 底部固定导航栏 */
.shr {
  height: 52px;
}
.shroud {
  position: fixed;
  bottom: 0px;
  right: 0px;
  left: 0px;
  .shroudPanel {
    display: flex;
    height: 52px;
    justify-content: space-between;
    text-align: center;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    background-color: #ffffff;
    & > .icon {
      margin-right: 17px;
      box-sizing: border-box;
      position: relative;
      margin-left: 17px;
      height: 52px;
      padding-top: 4px;
      flex: 1;
      .iconrun {
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 999;
      }
      .img {
        img {
          width: 26px;
          height: 26px;
        }
      }
    }
    .icon {
      & > span {
        display: block;
        font-size: 9px;
        color: #5d5d5d;
        height: 10px;
        line-height: 10px;
      }
      & > .con {
        color: #555565;
      }
    }
  }
}
.message {
  position: relative;
  .list_message {
    position: absolute;
    width: 19px;
    height: 30px;
    top: 0px;
    left: 0px;
    right: 0px;
    margin: 0 auto;
  }
  .message_sum {
    position: absolute;
    box-sizing: border-box;
    width: 28px;
    height: 18px;
    background-color: #ff522d;
    border: 1px solid #fb4d2a;
    font-size: 12px;
    color: #fff;
    border-radius: 10px;
    top: -5px;
    right: -20px;
  }
}
.list_message {
  .item_message {
    display: block;
    float: left;
    width: 3px;
    height: 3px;
    margin-top: 11px;
    margin-left: 3px;
    background-color: #fff;
  }
}
</style>